package tree;

public class IntTreeNode {

  private int value;

  private IntTreeNode left;

  private IntTreeNode right;

  private IntTreeNode parent;

  public IntTreeNode(int value) {
    this.value = value;
    this.left = null;
    this.right = null;
    this.parent = null;
  }

  public int getValue() {
    return value;
  }

  public void setValue(int value) {
    this.value = value;
  }

  public IntTreeNode getLeft() {
    return left;
  }

  public void setLeft(IntTreeNode left) {
    this.left = left;
    if (this.left != null) {
      this.left.setParent(this);
    }
  }

  public IntTreeNode getRight() {
    return right;
  }

  public void setRight(IntTreeNode right) {
    this.right = right;
    if (this.right != null) {
      this.right.setParent(this);
    }
  }

  public IntTreeNode getParent() {
    return parent;
  }

  public void setParent(IntTreeNode parent) {
    this.parent = parent;
  }
}
